import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/index.vue'
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'home',
    meta:{
      isBackShow:'false'
    },
    children:[{
      path:'home',
      name:'homePage',
      component:()=>import("@/views/home/index.vue")
    },{
      path: '/query',
      name:'query',
      component:()=>import("@/views/query/index.vue")
    }]
  },

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

router.beforeEach(()=>{
  NProgress.start();
})

router.afterEach(()=>{
  NProgress.done()
})

export default router
